<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticleCatesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('article_cates', function (Blueprint $table) {
            $table->increments('id')->unsigned()->comment('文章分类id');
            $table->string('cate_name', 100)->nullable()->comment('分类名称');
            $table->string('link_href', 100)->nullable()->comment('链接 默认为空 空代表列表页 不为空则代表跳转到其他页面');
            $table->string('cate_img', 100)->nullable()->comment('分类图片');
            $table->tinyInteger('sort_order')->unsigned()->nullable()->comment('排序号');
            $table->tinyInteger('is_forbid')->default(0)->unsigned()->nullable()->comment('是否被禁止 0:否 1:是');
            $table->integer('parent_id')->unsigned()->nullable()->comment('父级分类');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('article_cates');
    }
}
